package com.jf.listener;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.annotation.WebListener;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-09-01
 * Time:22:25
 */
@WebListener
public class JFServletContextAttributeListener implements ServletContextAttributeListener {
    @Override
    public void attributeAdded(ServletContextAttributeEvent servletContextAttributeEvent) {
        System.out.println("Detected that " + servletContextAttributeEvent.getName() + " - " + servletContextAttributeEvent.getValue()
         + " is added");
    }

    @Override
    public void attributeRemoved(ServletContextAttributeEvent servletContextAttributeEvent) {
        System.out.println("Detected that " + servletContextAttributeEvent.getName() + " - " + servletContextAttributeEvent.getValue()
                + " is removed");
    }

    @Override
    public void attributeReplaced(ServletContextAttributeEvent servletContextAttributeEvent) {
        System.out.println("Detected that " + servletContextAttributeEvent.getName() + " - " + servletContextAttributeEvent.getValue()
                + " is replaced");

    }
}
